package edu.sctu.zcy.month201506.day20150607;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by user24 on 2015/6/7.
 */
public class ThreadDemo extends Thread {

//    public int count1;
    public volatile boolean c = true;

//    public ThreadDemo(int count1) {
//        this.count1 = count1;
//
//    }

    public void run() {

        System.out.println("开始计时:");
        while (c) {
            for (int i = 1; i < 20; i++) {

                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                System.out.println("已经过去" + i + "秒");

            }



        }
    }
}
